import java.util.Scanner;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:素数回文
 * User: wangxin
 * Date: 2024-10-15
 * Time: 22:51
 */
public class test1 {
    public static boolean isPrime(long t){
        for(int i = 2;i < Math.sqrt(t);i++){
            if(t % i == 0){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

        int t = in.nextInt();
        StringBuffer s1 = new StringBuffer( String.valueOf(t));
        Stack<Character> stack = new Stack<>();
        for(int i = 0;i < s1.length() - 1;i++){
            stack.push(s1.charAt(i));
        }
        while(!stack.isEmpty()){
            s1.append(stack.pop());
        }
        long t1 = Long.parseLong(s1.toString());
        if(isPrime(t1)){
            System.out.println("prime");
        }else{
            System.out.println("noprime");

        }


    }
}
